package com.ctg.itrdc.sysmgr.permission.core;

import java.util.List;
import java.util.Map;

import com.ctg.itrdc.sysmgr.permission.core.dto.CommonRegionDTO;
import com.ctg.itrdc.sysmgr.permission.core.dto.FuncCompDTO;
import com.ctg.itrdc.sysmgr.permission.core.dto.FuncMenuDTO;
import com.ctg.itrdc.sysmgr.permission.core.dto.OrganizationDTO;
import com.ctg.itrdc.sysmgr.permission.core.dto.PoliticalLocationDTO;
import com.ctg.itrdc.sysmgr.permission.core.dto.StaffDTO;
import com.ctg.itrdc.sysmgr.permission.core.dto.SystemPostDTO;
import com.ctg.itrdc.sysmgr.permission.core.dto.SystemRolesDTO;
import com.ctg.itrdc.sysmgr.permission.core.dto.SystemUserDTO;

public interface IPermissionService {

	List<String> getRoleCodes(Long sysUserId, Long sysPostId);

	List<String> getPermissions(Long sysUserId, Long sysPostId);

	Map<String, Object> getUserByUsername(String userName);

	void updateLoginNum(Long sysUserId);

	boolean existRelation(Long sysUserId, Long sysPostId);

	List<Map<String, Object>> getPostByUId(Long sysUserId);

	List<Map<String, Object>> selectMenuTree(Long sysUserId, Long sysPostId);

	List<Map<String, Object>> selectCompList(Long sysUserId, Long sysPostId);

	List<Map<String, Object>> getRoleByUId(Long sysUserId);
	
	Map<String, Object> getOrgById(Long orgId);

	Map<String, Object> getStaffById(Long staffId);

	Map<String, Object> getPostById(Long sysPostId);

	Map<String, Object> getUserById(Long sysUserId);

	void updatePassword(Long sysUserId, String npwd);
	
	Map<String, Object> getStaffNameById(Long staffId);

	Map<String, Object> getRzOrgIdByStaffId(Long staffId);

	Map<String, Object> getRzOrgCodeById(Long rzOrgId);

	Map<String, Object> getOrgByUserIdAndPostId(Long userId, Long postId);

	Map<String, Object> getRegionNameById(Long comRegionId);

	/**
	 * 传入regionId以及想要查找的祖父region的type以获取祖父region的信息
	 * @param commonRegionId
	 * @param regionType
	 * @return null：其祖父节点中没有type类型的region。<br>
	 * 否则返回一个包含祖父region信息的map,map以common_region表的字段作为key，
	 * 对应的value值即为字段对应信息。
	 */
	Map<String, Object> getParRegionByType(Long commonRegionId,
			String regionType);

	List<Map<String, Object>> getPoliticalLocation(Long regionId, String locType);

	SystemUserDTO getUserBySysUserCode(String sysUserCode);

	List<SystemPostDTO> getPostByUserId(Long sysUserId);

	List<SystemRolesDTO> getRoleByUserId(Long sysUserId);

	List<FuncMenuDTO> getMenuTree(Long sysUserId, Long sysPostId);

	List<FuncCompDTO> getCompList(Long sysUserId, Long sysPostId);

	OrganizationDTO getOrgByOrgId(Long orgId);

	StaffDTO getStaffByStaffId(Long staffId);

	SystemPostDTO getPostByPostId(Long sysPostId);

	SystemUserDTO getUserByUserId(Long sysUserId);

	OrganizationDTO getOrgByUserAndPostId(Long userId, Long postId);

	CommonRegionDTO getParentRegionByType(Long commonRegionId, String regionType);

	String getStaffNameByStaffId(Long staffId);

	Long getRzOrgIdBystaffid(Long staffId);

	String getRzOrgCodeByOrgId(Long orgId);

	String getRegionNameByRegionId(Long comRegionId);

	PoliticalLocationDTO getPoliticalLocationByRegionId(Long regionId);
}
